using System;
using System.Xml;

namespace FreeFlow.Client
{
	/// <summary>
	/// A column in a grid.
	/// </summary>
	[Serializable]
	public class GridColumn
	{
    internal GridColumn(XmlElement columnNode)
    {
      if (columnNode != null)
      {
        caption = columnNode.GetAttribute("Caption");
        width = int.Parse(columnNode.GetAttribute("Width"));
        usage = Field.UsageFromString(columnNode.GetAttribute("Usage"));
      }
    }

    private string caption;
    /// <summary>
    /// Gets the caption of the column.
    /// </summary>
    public string Caption
    {
      get
      {
        return caption;
      }
    }

    private int width;
    /// <summary>
    /// Gets the width of the column.
    /// </summary>
    public int Width
    {
      get
      {
        return width;
      }
    }

    private FieldUsage usage;
    /// <summary>
    /// Gets the usage of the column.
    /// </summary>
    public FieldUsage Usage
    {
      get
      {
        return usage;
      }
    }
	}
}
